package com.sugar.follow.up.module.business.controller.app.record.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

@Data
public class AppRecordAnswerReqVO {

    @Schema(description = "类型（1问卷 2随访）", hidden = true)
    @NotNull(message = "类型不能为空")
    private Integer type;

    @Schema(description = "答题列表", hidden = true)
    @NotNull(message = "答题列表不能为空")
    @Size(min = 1, message = "答题列表不能为空")
    @Valid
    private List<Question> questions;

    @Data
    public static class Question {

        @Schema(description = "问题ID", hidden = true)
        @NotNull(message = "问题ID不能为空")
        private Long questionId;

        @Schema(description = "答案", hidden = true)
        @NotNull(message = "答案不能为空")
        private String answer;
    }
}
